using System;
using System.Collections.Generic;
using System.Text;

namespace DailyTestBLL.VirtualEvent
{
    public interface IBaseAdd<T>
    {
        bool Add(T t1, T t2);
        bool Add(T t1, T t2, T t3);
        bool Add(params T[] param);
    }

    public abstract class absAdd<T> : IBaseAdd<T>
    {

        #region IBaseAdd<T> Members

        public virtual bool Add(T t1, T t2)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public virtual bool Add(T t1, T t2, T t3)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        public virtual bool Add(params T[] param)
        {
            throw new Exception("The method or operation is not implemented.");
        }

        #endregion
    }

    public class TAdd : absAdd<int>
    {
        public override bool Add(int t1, int t2)
        {
            return base.Add(t1, t2);
        }

        public override bool Add(int t1, int t2, int t3)
        {
            return base.Add(t1, t2, t3);
        }
    }

    public class SAdd : absAdd<string>
    {
        public override bool Add(string t1, string t2)
        {
            return base.Add(t1, t2);
        }
    }

    public class FAdd : absAdd<float>
    {
        public override bool Add(float t1, float t2)
        {
            return base.Add(t1, t2);
        }
    }

    public class UseThem
    {
        public void UAdd()
        {
            TAdd ta = new TAdd();
            ta.Add(1, 2);
            SAdd sa = new SAdd();
            sa.Add("1", "2");
            FAdd fa = new FAdd();
            fa.Add(1.1f, 1.3f);
        }
    }
}
